function myCls(){
    this.name="测试"
}

myCls.prototype.say=function(){
    return this.name
}

let my=new myCls()
console.log(my.say())

class myCls2{
    constructor(name){
        name=name
    }
    say(){
        return this.name
    }
}